﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using HMP.GUI;
using HMP.DA;
using System.Windows.Forms;
namespace HMP.BL
{
    //Check existence of user name and password when uer log in
    class CheckDataBL
    {
      public static bool KTTonTai(string username)
      {
          using (QLTTBNEntities context = new QLTTBNEntities())
          {
              bool check = true;
              var query = from p in context.tbUsers select p; ;
              foreach (var row in query)
              {
                  if (row.UserID == username)
                  {
                      check = true;
                      break;
                  }
                  else
                      check = false;
              }
              return check;
          }
         
      }
   
    }
}